
package com.ami.iusb;

import java.io.IOException;
import java.io.RandomAccessFile;

public class RootDirectory {
	public byte[] filename = new byte[8];
	public byte[] ext = new byte[3];
	public byte attributes = 0;
	public byte upper = 0;

	public byte create_millsec = 0;
	public short create_time = 0;
	public short create_date = 0;
	public short access_date = 0;
	public long fat32_reserved = 0L;
	public short modify_time = 0;
	public short modify_date = 0;
	public long start_cluster = 0L;
	public int file_size = 0;

	public RootDirectory() {
		for (int i = 0; i < 8; i++) {
			this.filename[i] = 32;
		}
		for (int i = 0; i < 3; i++)
			this.ext[i] = 32;
		this.attributes = 0;
		this.upper = 0;

		this.create_millsec = 0;
		this.create_time = 0;
		this.create_date = 0;
		this.access_date = 0;
		this.fat32_reserved = 0L;
		this.modify_time = 0;
		this.modify_date = 0;
		this.start_cluster = 0L;
		this.file_size = 0;
	}

	public void readFileRootDirectory(RandomAccessFile paramRandomAccessFile, long paramLong) {
		try {
			paramRandomAccessFile.seek(paramLong);
			for (int i = 0; i < 8; i++) {
				this.filename[i] = ((byte) paramRandomAccessFile.readUnsignedByte());
			}
			for (int i = 0; i < 3; i++) {
				this.ext[i] = ((byte) paramRandomAccessFile.readUnsignedByte());
			}

			this.attributes = ((byte) paramRandomAccessFile.readUnsignedByte());
			this.upper = ((byte) paramRandomAccessFile.readUnsignedByte());
			this.create_millsec = ((byte) paramRandomAccessFile.readUnsignedByte());

			this.create_time = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.create_date = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.access_date = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.fat32_reserved = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.modify_time = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.modify_date = ((short) MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE));
			this.start_cluster = MBR.ChangeToLittleEndian(paramRandomAccessFile.readUnsignedShort(), 2,
					MBR.LITTLE_ENDIAN_TYPE);
			this.file_size = MBR.ChangeToLittleEndian(paramRandomAccessFile.readInt(), 4, MBR.LITTLE_ENDIAN_TYPE);

		} catch (IOException localIOException) {
			System.out.println("readFileRootDirectory() => " + localIOException);
		}
	}
}

/*
 * Location:
 * D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\iusb\RootDirectory.class Java
 * compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */